﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
    <Style x:Key="SkinCheckBox" TargetType="CheckBox">
        <Setter Property="OverridesDefaultStyle" Value="True" />
        <Setter Property="Canvas.Top">
            <Setter.Value>
                <Binding Path="Unchecked.Top" />
            </Setter.Value>
        </Setter>
        <Setter Property="Canvas.Left">
            <Setter.Value>
                <Binding Path="Unchecked.Left" />
            </Setter.Value>
        </Setter>
        <Setter Property="Height">
            <Setter.Value>
                <Binding Path="Unchecked.Height" />
            </Setter.Value>
        </Setter>
        <Setter Property="Width">
            <Setter.Value>
                <Binding Path="Unchecked.Width" />
            </Setter.Value>
        </Setter>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate 
                        TargetType="{x:Type CheckBox}">
                    <Image Name="image" Source="{Binding Path=Unchecked.Source}"
                               Cursor="{Binding Path=Unchecked.Cursor}"/>
                    <ControlTemplate.Triggers>
                        <MultiTrigger>
                            <MultiTrigger.Conditions>
                                <Condition Property="IsMouseOver" Value="False" />
                                <Condition Property="IsChecked" Value="True" />
                                <!--<Condition Binding="{Binding Path=MouseOver.Source, Converter={StaticResource isNullConverter}}" Value="False" />-->
                            </MultiTrigger.Conditions>
                            <Setter TargetName="image" Property="Source">
                                <Setter.Value>
                                    <Binding Path="Checked.Source" />
                                </Setter.Value>
                            </Setter>
                            <Setter TargetName="image" Property="Cursor">
                                <Setter.Value>
                                    <Binding Path="Checked.Cursor" />
                                </Setter.Value>
                            </Setter>
                            <Setter Property="Canvas.Top">
                                <Setter.Value>
                                    <Binding Path="Checked.Top" />
                                </Setter.Value>
                            </Setter>
                            <Setter Property="Canvas.Left">
                                <Setter.Value>
                                    <Binding Path="Checked.Left" />
                                </Setter.Value>
                            </Setter>
                            <Setter Property="Height">
                                <Setter.Value>
                                    <Binding Path="Checked.Height" />
                                </Setter.Value>
                            </Setter>
                            <Setter Property="Width">
                                <Setter.Value>
                                    <Binding Path="Checked.Width" />
                                </Setter.Value>
                            </Setter>
                        </MultiTrigger>
                        <MultiTrigger>
                            <MultiTrigger.Conditions>
                                <Condition Property="IsMouseOver" Value="True" />
                                <Condition Property="IsChecked" Value="True" />
                                <!--<Condition Binding="{Binding Path=MouseOver.Source, Converter={StaticResource isNullConverter}}" Value="False" />-->
                            </MultiTrigger.Conditions>
                            <Setter TargetName="image" Property="Source">
                                <Setter.Value>
                                    <Binding Path="CheckedMouseOver.Source" />
                                </Setter.Value>
                            </Setter>
                            <Setter TargetName="image" Property="Cursor">
                                <Setter.Value>
                                    <Binding Path="CheckedMouseOver.Cursor" />
                                </Setter.Value>
                            </Setter>
                            <Setter Property="Canvas.Top">
                                <Setter.Value>
                                    <Binding Path="CheckedMouseOver.Top" />
                                </Setter.Value>
                            </Setter>
                            <Setter Property="Canvas.Left">
                                <Setter.Value>
                                    <Binding Path="CheckedMouseOver.Left" />
                                </Setter.Value>
                            </Setter>
                            <Setter Property="Height">
                                <Setter.Value>
                                    <Binding Path="CheckedMouseOver.Height" />
                                </Setter.Value>
                            </Setter>
                            <Setter Property="Width">
                                <Setter.Value>
                                    <Binding Path="CheckedMouseOver.Width" />
                                </Setter.Value>
                            </Setter>
                        </MultiTrigger>
                        <MultiTrigger>
                            <MultiTrigger.Conditions>
                                <Condition Property="IsMouseOver" Value="True" />
                                <Condition Property="IsChecked" Value="False" />
                                <!--<Condition Binding="{Binding Path=MouseOver.Source, Converter={StaticResource isNullConverter}}" Value="False" />-->
                            </MultiTrigger.Conditions>
                            <Setter TargetName="image" Property="Source">
                                <Setter.Value>
                                    <Binding Path="UncheckedMouseOver.Source" />
                                </Setter.Value>
                            </Setter>
                            <Setter TargetName="image" Property="Cursor">
                                <Setter.Value>
                                    <Binding Path="UncheckedMouseOver.Cursor" />
                                </Setter.Value>
                            </Setter>
                            <Setter Property="Canvas.Top">
                                <Setter.Value>
                                    <Binding Path="UncheckedMouseOver.Top" />
                                </Setter.Value>
                            </Setter>
                            <Setter Property="Canvas.Left">
                                <Setter.Value>
                                    <Binding Path="UncheckedMouseOver.Left" />
                                </Setter.Value>
                            </Setter>
                            <Setter Property="Height">
                                <Setter.Value>
                                    <Binding Path="UncheckedMouseOver.Height" />
                                </Setter.Value>
                            </Setter>
                            <Setter Property="Width">
                                <Setter.Value>
                                    <Binding Path="UncheckedMouseOver.Width" />
                                </Setter.Value>
                            </Setter>
                        </MultiTrigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>